import bus from '@/bus'
import { renderButton } from '@/util'
let data = {
  status: 'pass',
  totalItem: 1,
  pageSize: window.$pageSize,
  currentPage: 1,
  form: {
    policyName: '',
    tiresRim: '',
    tiresWidth: '',
    tiresFigure: '',
    tiresType: ''
  },
  columns: [{
    type: 'selection',
    width: 60,
    align: 'left'
  }, {
    title: '政策名称',
    key: 'policyName',
    align: 'left',
    minWidth: 200,
    tooltip: true
  }, {
    renderHeader: (h, p) => {
      let inner = h('div', [
        h('span', '修改时间'),
        h('Icon', {
          props: {
            type: 'ios-help-circle',
            size: 18
          }
        })
      ])
      return h('Tooltip', {
        props: {
          content: '最后一次修改的时间',
          placement: 'top',
          transfer: true
        }
      }, [inner])
    },
    key: 'modifyDate',
    align: 'left',
    minWidth: 200
  }, {
    title: '尺寸',
    key: 'tiresRim',
    align: 'left',
    minWidth: 150
  }, {
    title: '胎面宽',
    key: 'tiresWidth',
    align: 'left',
    minWidth: 150
  }, {
    title: '扁平率',
    key: 'tiresAspectratio',
    align: 'left',
    minWidth: 150
  }, {
    title: '花纹',
    key: 'tiresFigure',
    align: 'left',
    minWidth: 150
  }, {
    title: '类型标识',
    key: 'tiresType',
    align: 'left',
    minWidth: 150
  }, {
    title: '层级',
    key: 'tiresLayer',
    align: 'left',
    minWidth: 150
  }, {
    title: '速度级别',
    key: 'tiresSpeed',
    align: 'left',
    minWidth: 150
  }, {
    title: '负荷指数',
    key: 'loadIndex',
    align: 'left',
    minWidth: 150
  }, {
    title: '操作',
    align: 'right',
    minWidth: 150,
    render: (h, params) => {
      const row = params.row
      let editBtn = renderButton(h, { text: '编辑', type: 'primary' }, ()=>{ bus.$emit("onEdit", { id: row.id })})
      let delBtn = renderButton(h, { text: '删除', type: 'warning' }, ()=>{ bus.$emit("onDelete", row.id, params.index)})
      return h('div', [editBtn, delBtn])
    }
  }],
  data: []
}
export default data